<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

<ui:composition template="/templates/principal.xhtml">

	<ui:define name="corpo">	
		<div id="adm">
			<div id="cabecario">
				<div id="img_adm">
					<h:graphicImage library="imagens" name="administracao.png"
						height="90" />
				</div>
				<div id="info_adm">
					<h1>Cadastrar funcionário</h1>
				</div>
				<div id="user_logado">
					<span>Usuario logado :</span>#{request.remoteUser}
				</div>
			</div>
			<div id="formulario" style="clear: both;">
				<h:form prependId="false">					
						<div style="padding-left: 30px; float: left; margin-bottom: 10px;">
							<h:messages />
							<h:inputHidden value="#{contratanteBean.contratado.codigo}" />
							<h:inputHidden value="#{contratanteBean.usuario.codigo}" />
							<h:inputHidden value="#{contratanteBean.endereco.codigo}" />

							<h:panelGrid columns="2">
								<h:outputLabel value="Nome " for="nome" />
								<h:inputText id="nome" label="Nome"
									value="#{contratanteBean.contratado.nome}" size="30"
									style="heght:30px;" />

								<h:outputLabel value="Hora entrada " for="horaentrada" />
								<h:inputText id="horaentrada" label="Hora entrada"
									value="#{contratanteBean.contratado.hora_entrada}" size="15"
									style="heght:30px;">
									<f:convertDateTime timeStyle="short" />
								</h:inputText>

								<h:outputLabel value="Hora saída " for="horasaida" />
								<h:inputText id="horasaida" label="Hora saída"
									value="#{contratanteBean.contratado.hora_saida}" size="15"
									style="heght:30px;">
									<f:convertDateTime timeStyle="short" />
								</h:inputText>
								
								<h:outputLabel value="Carteira de trabalho n° " for="carteira" />
								<h:inputText id="carteira" label="Carteira de trabalho"
									value="#{contratanteBean.contratado.num_carteira}" size="15"
									style="heght:30px;" />

								<h:outputLabel value="Série " for="serie" />
								<h:inputText id="serie" label="Série"
									value="#{contratanteBean.contratado.serie_carteira}" size="10"
									style="heght:30px;" />

								<h:outputLabel value="Cargo" for="cargo" />
								<h:inputText id="cargo" label="Cargo"
									value="#{contratanteBean.contratado.cargo}" size="30"
									style="heght:30px;" />
								<h:outputLabel value="Login" for="login" />
								<h:inputText id="login" label="Login"
									value="#{contratanteBean.usuario.login}" size="30"
									style="heght:30px;" />

								<h:outputLabel value="Senha " for="senha" />
								<h:inputText value="#{contratanteBean.usuario.senha}" size="15"
									id="senha" label="Senha" style="heght:30px;" />
								<h:outputLabel value="Confirmar senha " for="confirmaSenha" />
								<h:inputText value="#{contratanteBean.confirmaSenha}" size="15"
									id="confirmaSenha" label="Confirma Senha" style="heght:30px;" />
							</h:panelGrid>
						</div>
						<div style="padding-left: 30px; float: left; margin-bottom: 10px;">
							<h:panelGrid cellspacing="2" columns="2">
								<h:outputLabel value="CEP" for="cep" />
								<h:inputText id="cep" value="#{contratanteBean.endereco.cep}"
									maxlength="9" size="15" placeholder="Informe o CEP" />
								<h:outputLabel value="Rua" for="rua" />
								<h:inputText id="rua" value="#{contratanteBean.endereco.rua}"
									size="30" placeholder="Nome da Rua / Logradouro" />
								<h:outputLabel value="Numero" for="num" />
								<h:inputText value="#{contratanteBean.endereco.numero}" id="num"
									label="num" size="15" />
								<h:outputLabel value="Bairro" for="bairro" />
								<h:inputText id="bairro"
									value="#{contratanteBean.endereco.bairro}" size="30" />
								<h:outputLabel value="Cidade" for="cidade" />
								<h:inputText id="cidade" label="cidade"
									placeholder="Informe a Cidade"
									value="#{contratanteBean.endereco.cidade}" size="30" />
								<h:outputLabel value="UF" for="uf" />
								<h:inputText id="uf" label="uf"
									value="#{contratanteBean.endereco.uf}" size="10" />
							</h:panelGrid>
						</div>

						<div class="grid_7 map" id="map1"
							style="width: 500px; height: 280px; float: left;"></div>
						<div style="clear: both; padding-left: 140px; width: 300px;">
							<h:commandButton value="Salvar"
								action="#{contratanteBean.cadastrarFuncionario}"
								styleClass="button_login" />
							<h:commandButton value="Cancelar"
								action="/admin/contratante.xhtml" styleClass="button_login" />
						</div>				
				</h:form>
			</div>
		</div>
	</ui:define>
</ui:composition>

</html>